package com.zy.project.system.online.manager;

import com.zy.core.data.jpa.support.entity.page.Pagination;
import com.zy.core.data.jpa.support.manager.BaseManager;
import com.zy.project.system.online.entity.OnlineSession;
import com.zy.project.system.online.entity.UserOnline;
import com.zy.project.system.online.entity.base.BaseUserOnline;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * 用户在线会话管理
 * Package: com.zy.core.common.security.manager
 * <p>
 * Description： TODO
 * <p>
 * Author: zhangyu
 * <p>
 * Date: Created in 2018-11-4 13:26
 * <p>
 * Copyright: Copyright (c) 2018
 * <p>
 * Version: 0.0.1
 * <p>
 * Modified By:
 */
public interface UserOnlineManager extends BaseManager<UserOnline,String> {


    /**
     * 根据sessionId 强退用户
     * @param sessionId
     */
    void forceLoginoutBySessionId(String sessionId);

    /**
     * 查询过期的在线会话用户
     * @param date
     * @return
     */
    List<UserOnline> findByExpired(Date date);

    Collection<OnlineSession> findAllOnlineSession();

    void deleteByIds(String... ids);

    Pagination<OnlineSession> findAllOnlineSession(int pageNo, int pageSize);

}
